<div ng-form name="form" novalidate="novalidate">
    <div class="overlay-header" ng-if="mode == 'readonly'">在只读模式下您只能填写
        {{validate_role('V_PERFORMANCE_VOLUME_ALLOW_MODIFY_SALESMAN')?'销售顾问':''}}
        成本价
        返点
        商业保险
        {{validate_role('V_PERFORMANCE_VOLUME_ALLOW_MODIFY_DATE')?'日期':''}}
    </div>
    <div class="overlay-content">
        <div class="overlay-column overlay-column-4">
            <div class="overlay-item">
                <span class="overlay-name">结算单编号</span>
                <input type="text" ng-model="sales_vol.receipt_sn" disabled>

            </div>
            <div class="overlay-item">
                <span class="overlay-name">销售顾问</span>
                <salesman-picker ng-model="sales_vol.salesman"
                                 ng-required="true"
                                 ng-disabled="!validate_role('V_PERFORMANCE_VOLUME_ALLOW_MODIFY_SALESMAN')"
                                 name="salesman"
                                 shop-id="shop.id" ></salesman-picker>
                <p ng-show="form.salesman.$invalid"
                   class="overlay-item-bottom">
                    销售必填
                </p>
            </div>

            <div class="overlay-item" ng-if="!validate_role('V_PERFORMANCE_VOLUME_VEHICLE_MODEL_FREE_EDIT')">
                <span class="overlay-name">车型选择</span>
                <vm-selector  ng-disabled="mode == 'readonly'" vehicle-model="sales_vol.vehicle"></vm-selector>
            </div>

            <div class="overlay-item" ng-if="validate_role('V_PERFORMANCE_VOLUME_VEHICLE_MODEL_FREE_EDIT')">
                <span class="overlay-name">车型填写</span>
                <vm-input  ng-disabled="mode == 'readonly'" ng-model="sales_vol.vehicle" cost="true" ></vm-input>
            </div>

            <div class="overlay-item">
                <span class="overlay-name">成交价</span>
                <input type="number" min="0" step="100"
                       class="form-control"
                       ng-required="true"
                       ng-disabled="mode == 'readonly'"
                       name="amount"
                       ng-model="sales_vol.amount">
                <p ng-show="form.amount.$invalid" class="overlay-item-bottom">
                    成交价必填
                </p>
            </div>

            <div class="overlay-item">
                <span class="overlay-name">装潢销售</span>
                <input type="number" min="0" step="100"
                       ng-disabled="mode == 'readonly'"
                       ng-model="sales_vol.decoration_amount">
            </div>
            <div class="overlay-item">
                <span class="overlay-name">装潢赠送</span>
                <input type="number" step="100"
                       ng-disabled="mode == 'readonly'"
                       ng-model="sales_vol.decoration_present_amount">
            </div>
            <div class="overlay-item">
                <span class="overlay-name">其他装潢赠送</span>
                <input type="number" min="0" step="100"
                       ng-disabled="mode == 'readonly'"
                       ng-model="sales_vol.decoration_extra_amount">
            </div>
            <div class="overlay-item">
                <span class="overlay-name">售后赠送</span>
                <input type="number" min="0" step="100"
                       ng-disabled="mode == 'readonly'"
                       ng-model="sales_vol.after_sale_present_amount">
            </div>

        </div>
        <div class="overlay-column overlay-column-4">
            <div class="overlay-item">
                <span class="overlay-name">商业保险</span>
                <input type="number" min="0" step="100"
                       ng-model="sales_vol.insurance_amount">
            </div>
            <div class="overlay-item">
                <span class="overlay-name">上牌服务费</span>
                <input type="number" min="0" step="100"
                       ng-disabled="mode == 'readonly'"
                       ng-model="sales_vol.registration_fee">
            </div>
            <div class="overlay-item">
                <span class="overlay-name">融资服务费</span>
                <input type="number" min="0" step="100"
                       ng-disabled="mode == 'readonly'"
                       ng-model="sales_vol.loan_fee">
            </div>
            <div class="overlay-item">
                <span class="overlay-name">延保</span>
                <input type="number" min="0" step="100"
                       ng-disabled="mode == 'readonly'"
                       ng-model="sales_vol.extended_insurance_fee">
            </div>
            <div class="overlay-item">
                <span class="overlay-name">轮胎险</span>
                <input type="number" min="0" step="100"
                       ng-disabled="mode == 'readonly'"
                       ng-model="sales_vol.tyre_insurance_amount">
            </div>
            <div class="overlay-item">
                <span class="overlay-name">基盘项目</span>
                <input type="text" ng-disabled="mode == 'readonly'"
                       ng-model="sales_vol.jipan_amount">
            </div>
            <div class="overlay-item">
                <span class="overlay-name">售后赠送-充值</span>
                <input type="text" ng-disabled="mode == 'readonly'"
                       ng-model="sales_vol.after_sale_recharge_amount">
            </div>
            <div class="overlay-item">
                <span class="overlay-name">售后赠送-保养券</span>
                <input type="text" ng-disabled="mode == 'readonly'"
                       ng-model="sales_vol.after_sale_maintains_amount">
            </div>
            <div class="overlay-item">
                <span class="overlay-name">售后赠送-工时券</span>
                <input type="text" ng-disabled="mode == 'readonly'"
                       ng-model="sales_vol.after_sale_gongshi_amount">
            </div>
        </div>
        <div class="overlay-column overlay-column-4">
            <div class="overlay-item">
                <span class="overlay-name">日期</span>
                <datetimepicker class="form-control cursor-default"
                                ng-disabled="!validate_role('V_PERFORMANCE_VOLUME_ALLOW_MODIFY_DATE')"
                                ng-required="true"
                                name="date"
                                min-view="2"
                                ng-model="sales_vol.date">
                </datetimepicker>
                <p ng-show="form.date.$invalid" class="overlay-item-bottom">
                    日期必填
                </p>
            </div>

            <div class="overlay-item">
                <span class="overlay-name">车型</span>
                <input type="text" class="form-control"
                       ng-disabled="mode == 'readonly'"
                       ng-model="sales_vol.vehicle.brand">
            </div>
            <div class="overlay-item">
                <span class="overlay-name">型号</span>
                <input type="text" class="form-control"
                       ng-disabled="mode == 'readonly'"
                       ng-model="sales_vol.vehicle.model">
            </div>
            <div class="overlay-item">
                <span class="overlay-name">msrp</span>
                <input type="text" class="form-control" disabled
                       ng-disabled="mode == 'readonly'"
                       ng-model="sales_vol.vehicle.msrp">
            </div>
            <div class="overlay-item">
                <!-- <span class="overlay-name">
                    <select  ng-model="rebate_type"
                             ng-init ="rebate_type = ''">
                        <option value=""> 不返点 </option>
                        <option value="vip"> 大客户返点 </option>
                        <option value="test_drive"> 试乘试驾返点</option>
                    </select>
                </span> -->
                <span class="overlay-name">
                    <select ng-change="change(sales_vol.rebate_type)" ng-model="sales_vol.rebate_type">
                        <option value=""> 不返点 </option>
                        <option value="vip"> 大客户返点 </option>
                        <option value="test_drive"> 试乘试驾返点</option>
                    </select>
                </span>
                <input type="number" max="100" min="0"
                       ng-disabled = "sales_vol.rebate_type == null || sales_vol.rebate_type === 'vip'"
                       ng-model = "sales_vol.rebate_rate_view"
                       class="form-control" >
                <!-- div class="overlay-item-addon dropdown">
                    <div class="dropdown-toggle"
                         data-toggle="dropdown"
                         aria-haspopup="true"
                         aria-expanded="false">
                        {{new_volume.data.rebate_type_view || '不'}}返点
                        <span class="caret"></span>
                    </div>

                    <ul class="dropdown-menu">
                        <li class=" dropdown-toggle">
                            <a ng-click="set_rebate_type(sales_vol, null)">不</a>
                        </li>
                        <li class=" dropdown-toggle">
                            <a ng-click="set_rebate_type(sales_vol, 'vip')">大客户</a>
                        </li>
                        <li class=" dropdown-toggle">
                            <a ng-click="set_rebate_type(sales_vol, 'test_drive')">试乘试驾</a>
                        </li>
                    </ul>

                </div -->

            </div>
            <div class="overlay-item">
                <span class="overlay-name">置换补贴</span>
                <input type="text" class="form-control"
                       ng-model="sales_vol.replacement_subsidies">
            </div>
        </div>

        <div class="overlay-column overlay-column-4">
            <div class="overlay-item">
                <span class="overlay-name">颜色</span>
                <input type="text" class="form-control"
                       ng-disabled="mode == 'readonly'"
                       ng-model="sales_vol.vehicle_color">
            </div>
            <div class="overlay-item">
                <span class="overlay-name">客户姓名</span>
                <input type="text" class="form-control"
                       ng-disabled="mode == 'readonly'"
                       ng-model="sales_vol.customer">
            </div>

            <div class="overlay-item">
                <div class="overlay-item-top help-doc">
                    <p>大客户:[成交价 + 指导价 * 大客户返点 - (成本价 + 装潢赠送 + 售后赠送 )]/1.17  --大客户返点默认1.5%</p>
                    <p>试乘试驾车:{成交价 - [ 指导价 * (100% - 试乘试驾返点) + 装潢赠送 + 售后赠送 ]} /1.17</p>
                    <p>普通客户: [成交价 - (成本价 + 装潢赠送 + 售后赠送 ) ]/ 1.17</p>
                </div>
                <span class="overlay-name">直接差价</span>
                <input type="text"
                       class="form-control"
                       disabled=""
                       ng-model="sales_vol.difference_amount">
            </div>
            <div class="overlay-item">
                <div class="overlay-item-top help-doc">
                    <p>直接差价 + 上牌费 /1.06 + 融资服务费 /1.06 + 装潢费用 * 0.55 /1.17  + 装潢赠送 * 0.55/ 1.17 + 售后赠送 * 0.50 /1.17 - 装潢其他赠送 /1.17 + 保险 * 0.08 + 延保 * 0.2 +（40如果购买交强险）+ 置换补贴 /1.17</p>
                </div>
                <span class="overlay-name">总差价</span>
                <input type="text" class="form-control" disabled
                       ng-model="sales_vol.total_difference_amount">
            </div>
        </div>

    </div>
</div>
